home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 May / macformat-024.iso / Shareware City / Developers / TurboTCP 2.1 / TCL helper classes / CTCPApplication.h < prev    next >
Encoding:
Text File  |  1995-01-06  |  1.8 KB  |  65 lines  |  [TEXT/MMCC]

  1. //
  2. // CTCPApplication.h
  3. //
  4. //    TurboTCP library
  5. //    Application subclass
  6. //    TCL-specific class
  7. //
  8. //    Copyright © 1993-95, FrostByte Design / Eric Scouten
  9. //
  10.  
  11. #pragma once
  12.  
  13. #include "CApplication.h"
  14. #include "TurboTCP.buildflags.h"
  15.  
  16. #if !TurboTCP_TCL
  17.     #error: This file should be used with TCL projects only!
  18. #endif
  19.  
  20.  
  21. //***********************************************************
  22.  
  23. class CTCPApplication : public CApplication {
  24.  
  25. //    This application subclass should be used in place of the standard CApplication. It hooks
  26. //    into the event loop to handle MacTCP events which were queued at interrupt time, and
  27. //    takes care of opening and closing the MacTCP driver at the appropriate times.
  28. //
  29. //    NOTE: It is highly recommended that you enable background processing by turning on
  30. //    the “Background Null Events” SIZE resource flag. See the Set Project Type… dialog
  31. //    under the Project menu.
  32. //
  33. //    By default, TurboTCP sets the maximum sleep time to 90 ticks (1.5 seconds). Feel free
  34. //    to modify this behavior. However, I recommend that you use a setting somewhat lower
  35. //    than TCL’s default of 600 ticks (10 seconds). You may wish to use a lower value for
  36. //    high-performance applications, or a higher value to be more MultiFinder-friendly.
  37.  
  38.  
  39.     TCL_DECLARE_CLASS;
  40.     
  41. public:
  42.                         CTCPApplication();
  43.                         CTCPApplication(short extraMasters, Size aRainyDayFund,
  44.                             Size aCriticalBalance, Size aToolboxBalance);
  45.     void                    ITCPApplication(short extraMasters, Size aRainyDayFund,
  46.                             Size aCriticalBalance, Size aToolboxBalance);
  47.  
  48.     virtual void            MakeHelpers();
  49.  
  50.     // application shutdown
  51.     
  52.     virtual Boolean        Quit();
  53.  
  54.     // foreground/background event trapping
  55.  
  56.     virtual void            Process1Event();
  57.  
  58.  
  59.     // data members
  60.  
  61.     short                maxTCPEvents;                    // maximum number of TCP events to process
  62.     long                    maxTCPTicks;                    // maximum ticks to spend in TCP event loop
  63.  
  64. };
  65.